package whisper.api.gateway.frame.auth.config;

/**
 * Created by JT on 2017/9/23.
 */
public class DbConfig {

    public static final String TABLE_NAME_PREFIX = "WHISPER_";

    /**
     * Table : WHISPER_USER
     */
    public static final String TABLE_NAME_USER = String.format("%s%s",
            TABLE_NAME_PREFIX, "USER");
    public static final String[] TABLE_COLUMNS_USER = new String[]{
            "ID", "USERNAME", "PASSWORD", "CREATE_TIME", "LAST_LOGIN_TIME",
            "IS_AVAILABLE", "IS_OVERDUE", "IS_LOCK"
    };

    /**
     * Table : WHISPER_ROLE
     */
    public static final String TABLE_NAME_ROLE = String.format("%s%s",
            TABLE_NAME_PREFIX, "ROLE");
    public static final String[] TABLE_COLUMNS_ROLE = new String[]{
            "ID", "CODE", "NAME"
    };

    /**
     * Table : WHISPER_USER_ROLE
     */

    public static final String TABLE_NAME_USER_ROLE = String.format("%s%s",
            TABLE_NAME_PREFIX, "USER_ROLE");
    public static final String[] TABLE_COLUMNS_USER_ROLE = new String[] {
            "UID", "RID"
    };


    /**
     * Table ：WHISPER_PERMISSION
     */
    public static final String TABLE_NAME_PERMISSION = String.format("%s%s",
            TABLE_NAME_PREFIX, "PERMISSION");
    public static final String[] TABLE_COLUMNS_PERMISSION = new String[]{
            "ID", "NAME", "URL", "TYPE", "PARENT_ID", "SORT"
    };

    /**
     * Table : WHISPER_ROLE_PERMISSION
     */
    public static final String TABLE_NAME_ROLE_PERMISSION = String.format("%s%s",
            TABLE_NAME_PREFIX, "ROLE_PERMISSION");
    public static final String[] TABLE_COLUMNS_ROLE_PERMISSION = new String[] {
            "RID", "PID"
    };

}
